<?php
/**
 * Created by PhpStorm.
 * User: sks
 * Date: 2015/12/15
 * Time: 13:49
 */

class Involved_BankCardModel extends BaseModel{

    protected $table = 'user_bankcard';

    public function GetUserBankCard($user_id)
    {
        return DB::table($this->table)
            ->select('user_bankcard.auto_id','user_bankcard.is_valid','user_bankcard.bank_num','banklist.bank_name','banklist.bank_code','banklist.bank_logo')
            ->Join('banklist', 'banklist.bank_code', '=', 'user_bankcard.bank_code')
            ->where('user_id',$user_id)
            ->where('user_bankcard.is_valid','1')
            ->first();
    }
    /**
     *web我的银行卡
    **/
    public function WebUserBankCard($user_id)
    {
        return DB::table($this->table)
            ->select('bank_num')
            ->where('user_id',$user_id)
            ->where('user_bankcard.is_valid','1')
            ->first();
    }
}